package com.qingxin.cms.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;

/**
 * 巡查任务表
 */
@Entity
@Table(name = "inspection_task")
public class InspectionTask extends com.qingxin.sys.entity.BaseEntity implements
		java.io.Serializable {
	private static final long serialVersionUID = 4459357484215914798L;
	
	private String taskId;//任务ID
	private String inspecCode;//任务编号
	private String inspecName;//任务名称
	private String remark;//备注
	private String taskdesc;//任务描述
	private String status;//状态 0 1 2 
	private Date createTime;                                                                                                                                                                                                                                                                            
	private String createBy;
	private String updateBy;
	private Date updateTime;
	private String finishBy;//完成者
	private Date finishTime;//完成时间
	private Set<InspectionItem> inspectionItems = new HashSet<>(0);//巡查项目

	// Constructors

	/** default constructor */
	public InspectionTask() {
	}
	
	
	
	public InspectionTask(String taskId) {
		super();
		this.taskId = taskId;
	}



	public InspectionTask(String taskId, String inspecName) {
		super();
		this.taskId = taskId;
		this.inspecName = inspecName;
	}



	public InspectionTask(String taskId, String inspecCode, String inspecName,
			String remark, String taskdesc, String status, Date createTime) {
		super();
		this.taskId = taskId;
		this.inspecCode = inspecCode;
		this.inspecName = inspecName;
		this.remark = remark;
		this.taskdesc = taskdesc;
		this.status = status;
		this.createTime = createTime;
	}

	/** full constructor */
	public InspectionTask(String taskId, String inspecCode, String inspecName,
			String remark, String taskdesc, String status, Date createTime,
			String createBy, String updateBy, Date updateTime, String finishBy,
			Date finishTime, Set<InspectionItem> inspectionItems) {
		super();
		this.taskId = taskId;
		this.inspecCode = inspecCode;
		this.inspecName = inspecName;
		this.remark = remark;
		this.taskdesc = taskdesc;
		this.status = status;
		this.createTime = createTime;
		this.createBy = createBy;
		this.updateBy = updateBy;
		this.updateTime = updateTime;
		this.finishBy = finishBy;
		this.finishTime = finishTime;
		this.inspectionItems = inspectionItems;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "task_id", unique = true, nullable = false, length = 32)
	public String getTaskId() {
		return this.taskId;
	}

	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}

	@Column(name = "inspec_code", length = 20)
	public String getInspecCode() {
		return this.inspecCode;
	}

	public void setInspecCode(String inspecCode) {
		this.inspecCode = inspecCode;
	}

	@Column(name = "inspec_name", length = 50)
	public String getInspecName() {
		return this.inspecName;
	}

	public void setInspecName(String inspecName) {
		this.inspecName = inspecName;
	}

	@Column(name = "remark")
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "taskdesc")
	public String getTaskdesc() {
		return this.taskdesc;
	}

	public void setTaskdesc(String Taskdesc) {
		this.taskdesc = Taskdesc;
	}

	@Column(name = "status", length = 1)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "create_time", length = 23)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "create_by", length = 32)
	public String getCreateBy() {
		return this.createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	@Column(name = "update_by", length = 32)
	public String getUpdateBy() {
		return this.updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}

	@Column(name = "update_time", length = 23)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
	@Column(name = "finish_by", length = 32)
	public String getFinishBy() {
		return this.finishBy;
	}

	public void setFinishBy(String finishBy) {
		this.finishBy = finishBy;
	}

	@Column(name = "finish_time", length = 23)
	public Date getFinishTime() {
		return this.finishTime;
	}

	public void setFinishTime(Date finishTime) {
		this.finishTime = finishTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "inspectionTask")
	@JsonIgnore
	public Set<InspectionItem> getInspectionItems() {
		return this.inspectionItems;
	}

	public void setInspectionItems(Set<InspectionItem> inspectionItems) {
		this.inspectionItems = inspectionItems;
	}



}